// permission.js
import store from '@/store';

function checkArray(key) {
	let userInfo = store.getters.userInfo;
	let arr = userInfo.params || [];
	let index = arr.indexOf(key)
	if (index > -1) {
		return true // 有权限
	} else {
		return false // 无权限
	}
}

export const permission = function(el) {
	if (el) {
		let hasPermission = checkArray(el)
		return hasPermission;
	}
}
